#include <stdlib.h>

void *kmalloc(size_t);
void kfree(void *);

int main(void)
{
	char *something;
	char *something_more;
	char *even_more;
	char *humoungous;
	
	something = malloc(512);
	something_more = malloc(1024);
	KiAddMemoryToKernelPool(something, 512);
	KiAddMemoryToKernelPool(something_more, 1024);
	
	even_more = kmalloc(200);
	printf("1st malloc = %08X -- this should be equal to the 'current'+8 above me.\n", even_more);
	humoungous = kmalloc(1000);
	printf("2nd malloc = %08X -- this should be equal to the 'current'+8 above me.\n", humoungous);
	printf("\nabout to free %08X (2nd malloc)...\n", humoungous);
	kfree(humoungous);
	printf("\nabout to free %08X (1st malloc)...\n", even_more);
	kfree(even_more);
	
	free(something_more);
	free(something);
	
	return 0;
}
